]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
app: Use StIcon as icon_texture when loading from a GIcon
authorFlorian Müllner <fmuellner@gnome.org>
Sat, 29 Nov 2014 00:25:04 +0000 (00:25 +0000)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 29 Nov 2014 17:13:03 +0000 (18:13 +0100)
Themes - namely the HighContrast one - may now request symbolic
icons rather than fullcolor ones. In order to have recoloring
work as expected in that case, we will need a theme node to pick
up colors from - using an StIcon instead of manually loading a
texture from the cache gives us that for free, so do that.

https://bugzilla.gnome.org/show_bug.cgi?id=740447

src/shell-app.c

index a16ef5c8f3a20d859703e6d6b9efda35b2e594a9..2d98eb41a41e35a8d706d27e124fcd66e98a6418 100644 (file)
@@ -209,27 +209,23 @@ shell_app_create_icon_texture (ShellApp   *app,
                                int         size)
 {
   GIcon *icon;
-  gint scale;
   ClutterActor *ret;
-  ShellGlobal *global;
-  StThemeContext *context;
-
-  global = shell_global_get ();
-  context = st_theme_context_get_for_stage (shell_global_get_stage (global));
-  g_object_get (context, "scale-factor", &scale, NULL);
-  ret = NULL;
 
   if (app->info == NULL)
     return window_backed_app_get_icon (app, size);
 
+  ret = st_icon_new ();
+  st_icon_set_icon_size (ST_ICON (ret), size);
+
   icon = g_app_info_get_icon (G_APP_INFO (app->info));
   if (icon != NULL)
-    ret = st_texture_cache_load_gicon (st_texture_cache_get_default (), NULL, icon, size, scale);
-
-  if (ret == NULL)
+    {
+      st_icon_set_gicon (ST_ICON (ret), icon);
+    }
+  else
     {
       icon = g_themed_icon_new ("application-x-executable");
-      ret = st_texture_cache_load_gicon (st_texture_cache_get_default (), NULL, icon, size, scale);
+      st_icon_set_gicon (ST_ICON (ret), icon);
       g_object_unref (icon);
     }